package ru.tulupov.collectionsbenchmark.util;

/**
 * Time measuring tool
 * 
 * @author <a href="mailto:zhekka3@gmail.com">Eugene Tulupov</a>
 */
public class Timer {
	private long time;

	/**
	 * Starts measuring time
	 */
	public void start() {
		time = System.nanoTime();
	}

	/**
	 * Stops measuring time
	 * 
	 * @return Returns measured time in nanoseconds
	 */
	public double stop() {
		return (System.nanoTime() - time) * 1e-9;
	}
}
